<?php

/**
 * This is the model class for table "jarakkecamatan".
 *
 * The followings are the available columns in table 'jarakkecamatan':
 * @property integer $jk_id
 * @property integer $cipatujah
 * @property integer $karangnunggal
 * @property integer $cikalong
 * @property integer $pancatengah
 * @property integer $cikatomas
 * @property integer $cibalong
 * @property integer $parungponteng
 * @property integer $bantarkalong
 * @property integer $bojongasih
 * @property integer $culamega
 * @property integer $bojonggambir
 * @property integer $sodonghilir
 * @property integer $taraju
 * @property integer $salawu
 * @property integer $puspahiang
 * @property integer $tanjungjaya
 * @property integer $sukaraja
 * @property integer $salopa
 * @property integer $jatiwaras
 * @property integer $cineam
 * @property integer $karangjaya
 * @property integer $manonjaya
 * @property integer $gunungtanjung
 * @property integer $singaparna
 * @property integer $mangunreja
 * @property integer $sukarame
 * @property integer $cigalontang
 * @property integer $leuwisari
 * @property integer $padakembang
 * @property integer $sariwangi
 * @property integer $sukaratu
 * @property integer $cisayong
 * @property integer $sukahening
 * @property integer $rajapolah
 * @property integer $jamanis
 * @property integer $ciawi
 * @property integer $kadipaten
 * @property integer $pagerageung
 * @property integer $sukaresik
 */
class Jarakkecamatan extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Jarakkecamatan the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'jarakkecamatan';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('id_kecamatan,cipatujah, karangnunggal, cikalong, pancatengah, cikatomas, cibalong, parungponteng, bantarkalong, bojongasih, culamega, bojonggambir, sodonghilir, taraju, salawu, puspahiang, tanjungjaya, sukaraja, salopa, jatiwaras, cineam, karangjaya, manonjaya, gunungtanjung, singaparna, mangunreja, sukarame, cigalontang, leuwisari, padakembang, sariwangi, sukaratu, cisayong, sukahening, rajapolah, jamanis, ciawi, kadipaten, pagerageung, sukaresik', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			//array('jk_id, cipatujah, karangnunggal, cikalong, pancatengah, cikatomas, cibalong, parungponteng, bantarkalong, bojongasih, culamega, bojonggambir, sodonghilir, taraju, salawu, puspahiang, tanjungjaya, sukaraja, salopa, jatiwaras, cineam, karangjaya, manonjaya, gunungtanjung, singaparna, mangunreja, sukarame, cigalontang, leuwisari, padakembang, sariwangi, sukaratu, cisayong, sukahening, rajapolah, jamanis, ciawi, kadipaten, pagerageung, sukaresik', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'idKecamatan' => array(self::BELONGS_TO, 'Kecamatan', 'id_kecamatan'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'jk_id' => 'jk',
			'cipatujah' => 'Cipatujah',
			'karangnunggal' => 'Karangnunggal',
			'cikalong' => 'Cikalong',
			'pancatengah' => 'Pancatengah',
			'cikatomas' => 'Cikatomas',
			'cibalong' => 'Cibalong',
			'parungponteng' => 'Parungponteng',
			'bantarkalong' => 'Bantarkalong',
			'bojongasih' => 'Bojongasih',
			'culamega' => 'Culamega',
			'bojonggambir' => 'Bojonggambir',
			'sodonghilir' => 'Sodonghilir',
			'taraju' => 'Taraju',
			'salawu' => 'Salawu',
			'puspahiang' => 'Puspahiang',
			'tanjungjaya' => 'Tanjungjaya',
			'sukaraja' => 'Sukaraja',
			'salopa' => 'Salopa',
			'jatiwaras' => 'Jatiwaras',
			'cineam' => 'Cineam',
			'karangjaya' => 'Karangjaya',
			'manonjaya' => 'Manonjaya',
			'gunungtanjung' => 'Gunungtanjung',
			'singaparna' => 'Singaparna',
			'mangunreja' => 'Mangunreja',
			'sukarame' => 'Sukarame',
			'cigalontang' => 'Cigalontang',
			'leuwisari' => 'Leuwisari',
			'padakembang' => 'Padakembang',
			'sariwangi' => 'Sariwangi',
			'sukaratu' => 'Sukaratu',
			'cisayong' => 'Cisayong',
			'sukahening' => 'Sukahening',
			'rajapolah' => 'Rajapolah',
			'jamanis' => 'Jamanis',
			'ciawi' => 'Ciawi',
			'kadipaten' => 'Kadipaten',
			'pagerageung' => 'Pagerageung',
			'sukaresik' => 'Sukaresik',
			'id_kecamatan' => 'Kecamatan',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('jk_id',$this->jk_id);
		$criteria->compare('cipatujah',$this->cipatujah);
		$criteria->compare('karangnunggal',$this->karangnunggal);
		$criteria->compare('cikalong',$this->cikalong);
		$criteria->compare('pancatengah',$this->pancatengah);
		$criteria->compare('cikatomas',$this->cikatomas);
		$criteria->compare('cibalong',$this->cibalong);
		$criteria->compare('parungponteng',$this->parungponteng);
		$criteria->compare('bantarkalong',$this->bantarkalong);
		$criteria->compare('bojongasih',$this->bojongasih);
		$criteria->compare('culamega',$this->culamega);
		$criteria->compare('bojonggambir',$this->bojonggambir);
		$criteria->compare('sodonghilir',$this->sodonghilir);
		$criteria->compare('taraju',$this->taraju);
		$criteria->compare('salawu',$this->salawu);
		$criteria->compare('puspahiang',$this->puspahiang);
		$criteria->compare('tanjungjaya',$this->tanjungjaya);
		$criteria->compare('sukaraja',$this->sukaraja);
		$criteria->compare('salopa',$this->salopa);
		$criteria->compare('jatiwaras',$this->jatiwaras);
		$criteria->compare('cineam',$this->cineam);
		$criteria->compare('karangjaya',$this->karangjaya);
		$criteria->compare('manonjaya',$this->manonjaya);
		$criteria->compare('gunungtanjung',$this->gunungtanjung);
		$criteria->compare('singaparna',$this->singaparna);
		$criteria->compare('mangunreja',$this->mangunreja);
		$criteria->compare('sukarame',$this->sukarame);
		$criteria->compare('cigalontang',$this->cigalontang);
		$criteria->compare('leuwisari',$this->leuwisari);
		$criteria->compare('padakembang',$this->padakembang);
		$criteria->compare('sariwangi',$this->sariwangi);
		$criteria->compare('sukaratu',$this->sukaratu);
		$criteria->compare('cisayong',$this->cisayong);
		$criteria->compare('sukahening',$this->sukahening);
		$criteria->compare('rajapolah',$this->rajapolah);
		$criteria->compare('jamanis',$this->jamanis);
		$criteria->compare('ciawi',$this->ciawi);
		$criteria->compare('kadipaten',$this->kadipaten);
		$criteria->compare('pagerageung',$this->pagerageung);
		$criteria->compare('sukaresik',$this->sukaresik);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		 	'pagination'=>array(
		 		'pageSize'=>50,
    		),
		));
	}
}